/* ==========================================
   MODAL CARRINHO - ESTRUTURA (igual modal listas)
   ========================================== */

#modal-carrinho {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

#modal-carrinho.abrindo,
#modal-carrinho.fechando,
#modal-carrinho.aberto {
    display: flex;
}

#modal-carrinho .modal-card {
    background: var(--cart-bg);
    border: 2px solid var(--cart-accent);
    width: 0;
    height: 0;
    position: relative;
    box-shadow: 0 0 30px var(--cart-accent-glow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Animação de abertura */
#modal-carrinho.abrindo .modal-card {
    animation: carrinhoAbrir 0.85s forwards;
}
@keyframes carrinhoAbrir {
    0% { width: 0; height: 0; opacity: 0; }
    30% { width: 200px; height: 2px; opacity: 1; }
    60% { width: 200px; height: 120px; }
    100% { width: 450px; height: auto; min-height: 480px; max-height: 85vh; overflow-y: auto; opacity: 1; }
}

/* Estado aberto (caso precise manter depois da animação) */
#modal-carrinho.aberto .modal-card {
    width: 450px;
    height: auto;
    min-height: 480px;
    max-height: 85vh;
    overflow-y: auto;
}

/* Animação de fechamento */
#modal-carrinho.fechando .modal-card {
    animation: carrinhoFechar 0.7s forwards;
}
@keyframes carrinhoFechar {
    0% { width: 450px; height: auto; min-height: 480px; max-height: 85vh; opacity: 1; }
    40% { width: 200px; height: 120px; }
    70% { width: 200px; height: 2px; }
    100% { width: 0; height: 0; opacity: 0; }
}

/* Scroll interno */
.modal-card::-webkit-scrollbar {
    width: 4px;
}
.modal-card::-webkit-scrollbar-track {
    background: #0a0a0a;
}
.modal-card::-webkit-scrollbar-thumb {
    background: var(--cart-accent);
    border-radius: 4px;
}